package com.example.demo.service;

import com.example.demo.entity.AnotherComponent;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @ClassName: MyService
 * @Description: my service
 * @Author: shenxiang
 * @Date: 2021/11/19 23:20
 **/
@Component
public class MyService {


    @ConfigurationProperties(prefix = "another")
    @Bean
    public AnotherComponent anotherComponent(){
        return new AnotherComponent();
    }

}